package com.bdq.user.infrastructure.persistence.mysql.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdq.common.enums.YesOrNoEnum;
import com.bdq.user.infrastructure.persistence.mysql.service.UserLocationService;
import com.bdq.user.infrastructure.persistence.mysql.pojo.UserLocation;
import com.bdq.user.infrastructure.persistence.mysql.mapper.UserLocationMapper;
import org.springframework.stereotype.Service;

/**
* @author malei
* @description 针对表【user_location(用户所在地表)】的数据库操作Service实现
* @createDate 2024-05-04 09:38:04
*/
@Service
public class UserLocationServiceImpl extends ServiceImpl<UserLocationMapper, UserLocation>
    implements UserLocationService {

    @Override
    public UserLocation getByUserId(Long userId) {
        return lambdaQuery()
                .eq(UserLocation::getUserId, userId)
                .eq(UserLocation::getIsDeleted, YesOrNoEnum.NO.getCode())
                .one();
    }
}




